﻿<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>
        Dependency Property
      </Title>
      <Author>Brandon Blaine Gardner</Author>
      <Shortcut>depprop</Shortcut>
    </Header>
    <Snippet>
      <Declarations>
        <Literal>
          <ID>varType</ID>
          <ToolTip>The type of the variable (e.g.- int)</ToolTip>
          <Default>int</Default>
        </Literal>
        <Literal>
          <ID>varName</ID>
          <ToolTip>The name of the variable (e.g.- foo)</ToolTip>
          <Default>newDependencyVar</Default>
        </Literal>
        <Literal>
          <ID>defaultValue</ID>
          <ToolTip>The default value of the variable (e.g.- 5)</ToolTip>
          <Default>0</Default>
        </Literal>
      </Declarations>
    <Code Language="CSharp">
      <![CDATA[
        public $varType$ $varName$
        {
            get { return ($varType$)GetValue(property_$varName$); }
            set { SetValue(property_$varName$, value); }
        }
        public static readonly DependencyProperty property_$varName$ =
            DependencyProperty.Register(
            "$varName$", typeof($varType$), typeof(MainWindow),
            new UIPropertyMetadata($defaultValue$));
      ]]>
    </Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>